
		function set(val,name){
			localStorage.setItem(val,name)
		}
		function get(name){
		return	localStorage.getItem(name)
		}

$(".btn").click(function(){
								var yonghu =$("#yonghu").val();
								var shouji  = $("#shouji").val();
								var mima  = $("#mima").val();
								var queren  = $("#queren").val();
								var yong = /^[\u4e00-\u9fa5]{2,10}$/
								var telzz = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
								var paszz = /^(?!^[0-9]*$)(?!^[a-zA-Z]*$)(?!^[^a-zA-Z0-9]*$)\S{6,12}$/		
									if(yonghu&&shouji&&mima&&queren){
											if( yong.test(yonghu) == false){
												alert('yonghu错误')
											}else if( telzz.test(shouji) == false){
												alert('手机号错误')
											}else if( paszz.test(mima) == false){
												alert('密码是6-12位的数字和字母')
											}else if(mima !=queren){
												alert('两次密码输入不同')
											}else{
														var obj = {
													  "user":yonghu,
													  "pas":mima
													
												};
												console.log(11)
												var infos = get("infos");
												if(infos){
													var infos = JSON.parse(infos);
													infos.push(obj);
													set("infos",JSON.stringify(infos));
													console.log(11222)
												}
												else{
													set("infos",JSON.stringify([obj]));
													console.log(333)
												}
											}
										}else if(shouji == ''||mima == ''||yonghu == ''||queren==''){
									alert('请填写完整资料')
								}	
											
											
											
											
											
									
					
								
									
							
							
							
								
							
							
							
							
							
					})
$(".img1").click(function(){
		$(this).hide()
		$(".img2").show()
})
$(".img2").click(function(){
		$(this).hide()
		$(".img1").show()
})

var ss = true;

$('.enroll_huo').click(function(){
	
	
   		if(ss){
   			var i = 60;
			var btn = $(this);
				btn.html( i + "秒之后" );
				btn.timer = setInterval(function(){
					i--;
					ss = false;
					if(i == 0){
						ss = true;
						btn.html("获取验证码");
						clearInterval(btn.timer);
					}else{
						btn.html( i + "秒之后" );
						if(i){
							return true
						}
					}
					
				}, 1000);	
		}
			

			
		});	
		
		
		/*$.ajax({
			type:"get",
			url:"../json/user.json",
			async:true,
			success:function(data){
				console.log(data);
				$.each(data, function(i,n) {
					    admin =      n.user
					     Pass =    n.pas;
					     console.log(Pass,admin)
				});
				var  arr = [];
				   var data = data;
				   console.log(data);
				    function set1 (name,value){
				    	localStorage.setItem("infos",JSON.stringify(data))
				    }
				    console.log(set1());
				    var  infos = JSON.parse(localStorage.getItem("infos"))
			         //   var   JSON.par 	localStorage.getItem("infos")
			         console.log(infos)
				$(".btn").click(function(event){
					window.event || event;
					var  x= 1.0;
					var y = 2.0;
				 var  Psass= 	$("#mima").val()
				var    yonghu=	$("#yonghu").val()
					
					 if(Psass==Pass&& admin==yonghu){
					 	     
					 	alert("登录成功")
					 }else{
					 	alert("账号或者密码错误")
					 }
					
				})
				
			}
		});*/
		
		$(".lshz").click(function(){
			history.go(-1);
		})

		
		
					